<!-- 验证码模块 -->
<style>
.verify_container{
	height:30px;
}

.verify_container .verify_title{
	width:120px;
	text-align:right;
}

.verify_container .verify_title,.verify_container .verify_area{
	display:inline-block;
	float:left;
}

.verify_container .verify_area input{
	display: inline-block;
	height: 18px;
	width: 50px;
}

.verify_container .verify_area img{
	margin-left:5px;
	height:30px;
	width:85px;
	cursor:pointer;
}

.verify_container .verify_area a{
	position: relative;
	top:-10px;
	color:#578E6E;
	font-size:13px;
}
</style>

<script type="text/javascript">
$(function(){
	//刷新验证码
	$(".verify_container img,.verify_container .verify_refresh").click(function(){
		var img=$(".verify_container img");
		var timenow = new Date().getTime();
		img.attr("src",img.attr("src")+"?"+timenow);
	});
})
/**
 * 检查验证码
 * @param success 验证成功回调函数
 * @param input 验证码输入框
 * @param id 验证码编号
 */
function checkVerify(success,input,id){
	if(!isDefined(input)) input=$(".verify_input");
	if(!isDefined(id)) id="";
	var verify=input.val();
	if(verify.length==0){
		showTip(input,"请输入验证码！",'inner-left','bottom');
		input.focus();
		return false;
	}
	else if(verify.length<3){
		showTip(input,"请输入正确的验证码！",'inner-left','bottom');
		input.focus();
		return false;
	}else{
		hideTip(input);
		$.post(input.attr("ajax"),{"code":verify,"id":id},function(e){
			if(e.status==1){
				success();
			}else{
				showTip(input,"请输入正确的验证码！",'inner-left','bottom');
			}
			input.focus();
		},"json");
		return false;
	}
}
</script>

<div class="verify_container">
	<div class="verify_title">{$Think.lang.VERIFY}</div>
	<div class="verify_area">
		<input type="text" class="verify_input" maxlength="3" ajax="__APP__/{$Think.MODULE_NAME}/{$Think.CONTROLLER_NAME}/check_verify"/>
		<img src="__APP__/{$Think.MODULE_NAME}/{$Think.CONTROLLER_NAME}/verify" alt=""/>
		<a href="javascript:void(0)" class="verify_refresh">{$Think.lang.CLICK_REFRESH}</a>
	</div>
</div>